import scrapy
from imgsPro.items import ImgsproItem

class ImgSpider(scrapy.Spider):
    name = "img"
    # allowed_domains = ["www.xxx.com"]
    start_urls = ["https://sc.chinaz.com/tupian/"]

    def parse(self, response):
        print('************开始爬虫***************')
        div_images=response.xpath('/html/body/div[3]/div[2]/div')
        for img in div_images:
            item=ImgsproItem()
            # 注意使用伪属性
            div_image=img.xpath('./img/@data-original').extract_first()
            img_url='https:'+div_image
            item['url']=img_url

            yield item

